﻿using MediatR;
using SheepStorage.API.Application.Command.BodySizeCommand;
using SheepStorage.API.Application.Command.SheepConditionCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepConditionHandler
{
    public class SheepConditionFtHandler : IRequestHandler<SheepConditionFtCommand, Results<SheepCondition>>
    {
        private readonly ISheepConditionService service;

        public SheepConditionFtHandler(ISheepConditionService service)
        {
            this.service = service;
        }

        public async Task<Results<SheepCondition>> Handle(SheepConditionFtCommand request, CancellationToken cancellationToken)
        {
            return Results<SheepCondition>.DataResult(service.GetFtSheepCondition(request.SheepConditionId));
        }
    }
}
